package Dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBConnect  {

	protected static Connection connection;
	public static   Connection getConnection() {



		return connection;
	}

//	private static String url = "jdbc:mysql://www.papademas.net:3307/510fp?useSSL=false";
//	private static String username = "fp510";
//	private static String password = "510";
//	private static String url = "jdbc:mysql://127.0.0.1:3306/db1?autoReconnect=true&useSSL=false&serverTimezone=UTC";
//	private static String username = "root";
//	private static String password = "";

	private static String  url = "jdbc:mysql://www.papademas.net:3307/510fp?autoReconnect=true&useSSL=false";
	private static String username = "fp510";
	private static String password = "510";

	public  DBConnect() {
		try {
			connection = DriverManager.getConnection(url, username, password);
			System.out.println("connect create ");
		} catch (SQLException e) {
			System.out.println("Error creating connection to database: " + e);
			System.exit(-1);
		}
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		System.out.println("in close ");
		return super.clone();
	}
}
